package com.hongye.controller;

import java.util.List;

import com.hongye.app.model.TakeOutModel;
import com.hongye.util.PushUtils;
import com.jfinal.core.Controller;

public class TakeoutController extends Controller{
	public TakeoutController() {
		
	}
	
	/**
	 * 提现申请列表展示
	 * @author lifuqiang
	 * 2017-4-14
	 */
	public void takeoutView(){
		List<TakeOutModel> list = TakeOutModel.getTakeOutList();
		this.setAttr("takeoutlist", list);
		this.renderJsp("takeoutView.jsp");
	}
	
	/**
	 * 修改为完成提现状态(后台完成提现)
	 * @author lifuqiang
	 * 2017-4-14
	 */
	public void finishtakeout(){
		String id = this.getPara("id");
		boolean boo = TakeOutModel.finishTakeOut(id);
		String rs= null;
		if(boo){
			PushUtils.MSG_Single(TakeOutModel.getTakeOut_By_id(id).getStr("buyer_phone"), "D02", "您提现的"+TakeOutModel.getTakeOut_By_id(id).get("money")+"元资金到账啦！去看看吧！");
			rs = "suc";
		}else{
			rs = "fal";
		}
		this.renderText(rs);
	}
	
}
